package com.no.hq.mapper;

import com.no.hq.pojo.GoodsType;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;
import java.util.List;

@Mapper
@Repository
public interface GoodsTypeMapper {
    @Insert("insert into goods_type(goods_type_name) "
            + "values(#{goodsTypeName, jdbcType=VARCHAR})")
    void insertOne(GoodsType goodsType);

    @Select("select * from goods_type")
    @Results(value = {
            @Result(column = "goods_type_id", property = "goodsTypeId", jdbcType = JdbcType.INTEGER),
            @Result(column = "goods_type_name", property = "goodsTypeName", jdbcType = JdbcType.VARCHAR)
    })
    List<GoodsType> selectAll();
}
